/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __APP_USER_H
#define __APP_USER_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "elog.h"
#include "drv_pwm.h"
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
#define APP_ADC_CHANNLE_MAX 2
#define APP_ADC_DMA_REC_BUF_SIZE (64 >> 1)
#define RUNNING_INTERVAL 1000

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
extern uint16_t adc_rec_buf[APP_ADC_CHANNLE_MAX][APP_ADC_DMA_REC_BUF_SIZE];
extern volatile uint32_t adc_cover_finished[APP_ADC_CHANNLE_MAX];

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void app_run(void);
void app_user_init(void);


/* USER CODE BEGIN EFP */
static inline uint32_t clock_time_exceed(uint32_t ref, uint32_t ms)
{
	return ((uint32_t)(HAL_GetTick() - ref) > ms);
}
/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __APP_USER_H */
